#include <huniplacer_3d/PanelPart.h>

#include <iostream>
#include <string>
#include<cstring>

#include <GL/gl.h>
#include <GL/freeglut.h>

PanelPart::PanelPart(std::string picking_name, unsigned int x, unsigned int y, unsigned int width, unsigned int height, float r, float g, float b, float bg_r, float bg_g, float bg_b, char* value_type) :
					Picking(picking_name), 
					initial_name(picking_name),
					x(x), y(y), 
					width(width), height(height), 
					color_r(r), color_g(g), color_b(b), 
					bg_color_r(bg_r), bg_color_g(bg_g), bg_color_b(bg_b), 
					value_type(value_type) {

}

void PanelPart::translate_text(int x, int y) {
	glVertex2i(x, y);
	glRasterPos2f(x, y);
}

void PanelPart::draw_string(char* s) {
   if (s && strlen(s)) {
      while (*s) {
         glutBitmapCharacter(GLUT_BITMAP_8_BY_13, *s);
         s++;
      }
   }
}
